package day2.problem1;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double w = sc.nextDouble();
        String s = sc.next();
        int sum = 20;
        if(s.charAt(0) == 'y') {
            sum += 5;
        }
        if(w > 1) {
            sum += Math.ceil(w) - 1;
        }
        System.out.println(sum);
    }
}